/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author Cheng
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '/@/api/model/baseModel';

const { adminPath } = useGlobSetting();

export interface SupervisorApproval extends BasicModel<SupervisorApproval> {
  mainProcessId?:number; // 主流程id  由那个流程发起的
  hazardType?: string; // 隐患类型
  enterpriseId?: string; // 企业ID
  enterpriseName?: string; // 企业名称
  buildId?: number; // 建筑ID
  buildName?: string; // 建筑名称
  regionId?: number; // 区域ID
  regionName?: string; // 区域名称
  hazardDescription?: string; // 隐患说明
  isTimeout?: string; // 是否超时
  createTime?: string; // 创建时间
  delayTime?: string; // 延期时间
  supervisorName?: string; // 监督员姓名
  supervisorCode?: string; // 监督员code
  processStatus?: string; // 流程状态  已完成  未完成
  redisTaskCache?: string; // 将流程中的id保存
  tid: string; // 事务id
}

export const supervisorApprovalList = (params?: SupervisorApproval | any) =>
  defHttp.get<SupervisorApproval>({ url: adminPath + '/supervisor/approval/supervisorApproval/list', params });

export const supervisorApprovalListData = (params?: SupervisorApproval | any) =>
  defHttp.post<Page<SupervisorApproval>>({ url: adminPath + '/supervisor/approval/supervisorApproval/listData', params });

export const supervisorApprovalForm = (params?: SupervisorApproval | any) =>
  defHttp.get<SupervisorApproval>({ url: adminPath + '/supervisor/approval/supervisorApproval/form', params });

export const supervisorApprovalSave = (params?: any, data?: SupervisorApproval | any) =>
  defHttp.postJson<SupervisorApproval>({ url: adminPath + '/supervisor/approval/supervisorApproval/save', params, data });

export const supervisorApprovalDelete = (params?: SupervisorApproval | any) =>
  defHttp.get<SupervisorApproval>({ url: adminPath + '/supervisor/approval/supervisorApproval/delete', params });
